﻿package cn.rayyee.loader
{
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	/**
	 * ...
	 * @author 
	 */
	public class ReadXML 
	{
		
		public static function readInetAddress(_sXmlURL:String, _callBack:Function, _error:Function):void
		{
			var _urlRequest:URLRequest=new URLRequest(_sXmlURL);
			var _urlLoader:URLLoader = new URLLoader();
			_urlLoader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void { _error(e); } );
			_urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void 
														{ 	
															var _node:XML = new XML(e.target.data);
															_callBack(_node);
														});
			_urlLoader.load(_urlRequest);
		}
	}
}